/******************************************************************************
* File description: runningchartcurrent.qml
* Function: 实验运行：实时运行柱状图
* Current Version: 1.0.0
* Author: 张宇轩
* Date: 2024-08-26
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtGraphicalEffects 1.15
import QtCharts 2.15

Item {
    id: root

    /* property 定义开始 */

    /* property 定义结束 */

    ColumnLayout {
        anchors.fill: parent
        spacing: 0

        // 图例
        Item {
            Layout.fillWidth: true
            Layout.preferredHeight: 42

            RowLayout {
                anchors.fill: parent
                spacing: 17

                CustomHorSpacerItem {}

                // FAM
                CustomCheckBox {
                    id: famCheck
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
                    checkBoxText: "FAM"
                    checkWidth: 20
                    checkHeight: 20
                    checkRadius: 2
                    checkedFillColor: "#FFFF2B37"
                    checkBoxFontColor: "#FFFF2B37"
                    checkBorderColor: "#FFF"
                    checkedBorderColor: "transparent"
                    isChecked: true
                }

                // VIC
                CustomCheckBox {
                    id: vicCheck
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
                    checkBoxText: "VIC"
                    checkWidth: 20
                    checkHeight: 20
                    checkRadius: 2
                    checkedFillColor: "#FF422FCD"
                    checkBoxFontColor: "#FF422FCD"
                    checkBorderColor: "#FFF"
                    checkedBorderColor: "transparent"
                    isChecked: true
                }

                // ROX
                CustomCheckBox {
                    id: roxCheck
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
                    checkBoxText: "ROX"
                    checkWidth: 20
                    checkHeight: 20
                    checkRadius: 2
                    checkedFillColor: "#FF00C441"
                    checkBoxFontColor: "#FF00C441"
                    checkBorderColor: "#FFF"
                    checkedBorderColor: "transparent"
                    isChecked: true
                }

                // CY5
                CustomCheckBox {
                    id: cy5Check
                    Layout.alignment: Qt.AlignHCenter | Qt.AlignLeft
                    checkBoxText: "CY5"
                    checkWidth: 20
                    checkHeight: 20
                    checkRadius: 2
                    checkedFillColor: "#FFFF873E"
                    checkBoxFontColor: "#FFFF873E"
                    checkBorderColor: "#FFF"
                    checkedBorderColor: "transparent"
                    isChecked: true
                }

                CustomHorSpacerItem {}
            }
        }

        // 报表
        Rectangle {
            Layout.fillWidth: true
            Layout.fillHeight: true
            Layout.topMargin: 17
            color: "#C3FFFFFF"
            radius: 13

            ChartView {
                id: instantChart
                anchors.fill: parent
                antialiasing: true
                legend.visible: false
                margins.left: 0
                margins.bottom: 0
                backgroundColor: "transparent"
                backgroundRoundness: 0

                ValueAxis {
                    id: axisX
                    titleText: qsTr("孔位")
                    titleFont.family: "Alibaba PuHuiTi"
                    titleFont.pixelSize: 15
                    labelsFont.family: "Alibaba PuHuiTi"
                    labelsFont.pixelSize: 15
                    labelsColor: "#9A222222"
                    gridLineColor: "#00999999"
                    min: 0
                    max: 96
                    tickCount: 5
                    labelFormat: "%d"
                }

                ValueAxis {
                    id: axisY
                    titleText: qsTr("荧光强度")
                    titleFont.family: "Alibaba PuHuiTi"
                    titleFont.pixelSize: 15
                    labelsFont.family: "Alibaba PuHuiTi"
                    labelsFont.pixelSize: 15
                    labelsColor: "#9A222222"
                    gridLineColor: "#999"
                    min: 0
                    max: 20000
                    tickCount: 5
                    labelFormat: "%d"
                }

                BarSeries {
                    id: instantpline;
                    name: "SplineSeries"
                    axisX: axisX
                    axisY: axisY

                    BarSet {
                        color: "#FF2B37"
                        borderColor: "#FF2B37"
                        values: [
                            15000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16000, 0, 0, 0,
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            0, 0, 0, 0, 0, 0, 0, 18000, 0, 0, 0, 0, 0, 0, 0, 0,
                            0, 0, 0, 5000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                        ]
                    }
                }
            }
        }
    }
}
